package com.cscj.android.repository.repo.favorites

import android.graphics.Bitmap
import com.cscj.android.repository.db.entity.FavoritesEntity
import kotlinx.coroutines.flow.Flow

interface FavoritesRepository {

    suspend fun init()

    suspend fun favoriteLink(title: String, url: String, favicon: Bitmap?)

    fun allFavorites(): Flow<List<FavoritesEntity>>

    fun favorites(keyword: String? = null): Flow<List<FavoritesEntity>>

    suspend fun deleteByIds(ids: IntArray)

    fun checkUrlFavorite(url: String): Flow<Boolean>

    suspend fun deleteByUrl(url: String)

    suspend fun updateFavicon(url: String, favicon: Bitmap?)

}